<%@ page import="com.gaozhaoyang.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: 754165242
  Date: 2022/3/7
  Time: 19:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--创建java对象--%>
    <%
        User user = new User(1001,"pgone","洗头");

        User user1 = new User();
        user1.setUid(1002);
        user1.setName("lxl");
        user1.setHobby("哈拉少");

        System.out.println(user1.getUid() + "\t" + user1.getName()+ "\t" + user1.getHobby());
    %>
<%--动作标签创建对象--%>
<%--通过无参构造--%>
<jsp:useBean id="u1" class="com.gaozhaoyang.entity.User"></jsp:useBean>
<jsp:setProperty name="u1" property="uid" value="1003"></jsp:setProperty>
<jsp:setProperty name="u1" property="name" value="马荣"></jsp:setProperty>
<jsp:setProperty name="u1" property="hobby" value="洗屁股"></jsp:setProperty>
<jsp:getProperty name="u1" property="uid"/>
<jsp:getProperty name="u1" property="name"/>
<jsp:getProperty name="u1" property="hobby"/>
</body>
</html>
